<html>
<head><meta charset="utf-8"><title>rustc panic · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html">rustc panic</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="152682883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152682883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152682883">(Dec 29 2018 at 01:07)</a>:</h4>
<div class="codehilite"><pre><span></span>thread &#39;rustc&#39; panicked at &#39;no entry found for key&#39;, src/libcore/option.rs:1040:5ore
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev running on x86_64-apple-darwin

note: compiler flags: -Z osx-rpath-install-name -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C codegen-units=12 -C link-args=-Wl,-rpath,@loader_path/../lib --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `core`.

To learn more, run the command again with --verbose.
command did not execute successfully: &quot;rust/build/x86_64-apple-darwin/stage0/bin/cargo&quot; &quot;build&quot; &quot;--target&quot; &quot;x86_64-apple-darwin&quot; &quot;-j&quot; &quot;12&quot; &quot;--release&quot; &quot;--features&quot; &quot;panic-unwind backtrace&quot; &quot;--manifest-path&quot; &quot;rust/src/libstd/Cargo.toml&quot; &quot;--message-format&quot; &quot;json&quot;
expected success, got: exit code: 101
failed to run: rust/build/bootstrap/debug/bootstrap build --stage 1 src/libstd
Build completed unsuccessfully in 0:13:26
</pre></div>



<a name="152683419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152683419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152683419">(Dec 29 2018 at 01:25)</a>:</h4>
<p>Do report ICEs to the issue tracker, not here.</p>



<a name="152683438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152683438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152683438">(Dec 29 2018 at 01:26)</a>:</h4>
<p>Especially if it is reproducible and happens on a clean checkout (to remove the possibility of your own change of some sort causing it)</p>



<a name="152690787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152690787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152690787">(Dec 29 2018 at 05:24)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> <br>
If my code is causing the compiler to panic, how do I get the stack trace or something to get the location ?</p>



<a name="152702062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152702062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152702062">(Dec 29 2018 at 11:47)</a>:</h4>
<p>RUST_BACKTRACE=1 gives backtraces as usual.</p>



<a name="152710047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152710047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152710047">(Dec 29 2018 at 16:51)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span>  Apparently it does not give you backtrace on mac as said <a href="https://rust-lang.github.io/rustc-guide/compiler-debugging.html#getting-a-backtrace" target="_blank" title="https://rust-lang.github.io/rustc-guide/compiler-debugging.html#getting-a-backtrace">here</a>. I am wondering if there is a way of getting print statements while building the compiler as the panic in my case happens during building rustc. <a href="https://rust-lang.github.io/rustc-guide/compiler-debugging.html#getting-logging-output" target="_blank" title="https://rust-lang.github.io/rustc-guide/compiler-debugging.html#getting-logging-output">This</a> deals with debug statements while compiling a file with a built compiler and not during the build.</p>



<a name="152710097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152710097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152710097">(Dec 29 2018 at 16:52)</a>:</h4>
<p>You can use <code>eprintln!</code> in the compiler</p>



<a name="152710240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/152710240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#152710240">(Dec 29 2018 at 16:59)</a>:</h4>
<p>Thanks a lot <span class="user-mention" data-user-id="116466">@Zoxc</span> . Let me try that</p>



<a name="154098546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154098546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154098546">(Dec 31 2018 at 19:32)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> I believe that documentation is incorrect, I get backtraces for both my own code and <code>rustc</code> in mac 10.13</p>



<a name="154098787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154098787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154098787">(Dec 31 2018 at 19:39)</a>:</h4>
<p>In my case, I just got a line about the point of panic but not the entire call stack.</p>
<p>thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/blitz/rustc-dev/rust/src/libcore/slice/mod.rs:2455</p>
<p>Do you get the full stack ?</p>



<a name="154098832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154098832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154098832">(Dec 31 2018 at 19:40)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span></p>



<a name="154099090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099090">(Dec 31 2018 at 19:48)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> are you on a less standard platform, perhaps?</p>



<a name="154099503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099503">(Dec 31 2018 at 20:01)</a>:</h4>
<p>I do</p>



<a name="154099552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099552">(Dec 31 2018 at 20:02)</a>:</h4>
<div class="codehilite"><pre><span></span>$ RUST_BACKTRACE=full ./stage1/bin/rustc ../../src/test/ui/issues/issue-44023.rs -Ztreat-err-as-bug
error[E0308]: mismatched types
 --&gt; ../../src/test/ui/issues/issue-44023.rs:5:42
  |
5 |   fn საჭმელად_გემრიელი_სადილი ( ) -&gt; isize { //~ ERROR mismatched types
  |  __________________________________________^
6 | | }
  | |_^ expected isize, found ()
  |
  = note: expected type `isize`
             found type `()`

thread &#39;rustc&#39; panicked at &#39;encountered error with `-Z treat_err_as_bug&#39;, src/librustc_errors/lib.rs:490:13
stack backtrace:
   0:        0x10fe5521f - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hc6fe37d6df1f3fe5
   1:        0x10fe7f3cd - std::sys_common::backtrace::print::hb7f980371c0868d5
   2:        0x10fe76aa1 - std::panicking::default_hook::{{closure}}::h8241ef64100dd6cc
   3:        0x10fe76830 - std::panicking::default_hook::h60d1f8576b12717c
   4:        0x10d715921 - rustc::util::common::panic_hook::h69f8586f8a0f0325
   5:        0x10fe771d1 - std::panicking::rust_panic_with_hook::h3ddb1c46e6feced8
   6:        0x10f766cb4 - std::panicking::begin_panic::hc0718cb54d8ba326
   7:        0x10f7528c6 - rustc_errors::Handler::emit_db::h71b6a584809709bb
   8:        0x10f75f1cc - rustc_errors::diagnostic_builder::DiagnosticBuilder::emit::h7d0ef8ff5a1046cd
   9:        0x10ba1ba5c - &lt;rustc_typeck::check::coercion::CoerceMany&lt;&#39;gcx, &#39;tcx, &#39;exprs, E&gt;&gt;::coerce_inner::h4c499b4e1caffb2b
  10:        0x10bb50812 - rustc_typeck::check::FnCtxt::with_breakable_ctxt::ha4cc4bc83fcb08c3
  11:        0x10bb8fbe4 - rustc_typeck::check::FnCtxt::check_block_with_expected::hb13f83d0c4498f69
  12:        0x10bb81a40 - rustc_typeck::check::FnCtxt::check_expr_kind::h75e62a260248dbeb
  13:        0x10bb814e4 - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::hbe73d170359aeba1
  14:        0x10bb806ac - rustc_typeck::check::FnCtxt::check_return_expr::h2629ed759b193b8d
  15:        0x10bb7155d - rustc_typeck::check::check_fn::h200e74f0e5e3c2cb
  16:        0x10b9de428 - rustc::ty::context::GlobalCtxt::enter_local::hf6ba87dbedd33942
  17:        0x10bb70155 - rustc_typeck::check::typeck_tables_of::h162f840803ba1fe4
  18:        0x10d7d16fe - rustc::ty::query::&lt;impl rustc::ty::query::config::QueryAccessors&lt;&#39;tcx&gt; for rustc::ty::query::queries::typeck_tables_of&lt;&#39;tcx&gt;&gt;::compute::h1aa06c980f0e396c
  19:        0x10db6f73c - rustc::dep_graph::graph::DepGraph::with_task_impl::h4451d90f125a1e9a
  20:        0x10d7c7398 - &lt;rustc::ty::query::plumbing::JobOwner&lt;&#39;a, &#39;tcx, Q&gt;&gt;::start::he16f56a818977929
  21:        0x10d8e8412 - rustc::ty::query::plumbing::&lt;impl rustc::ty::context::TyCtxt&lt;&#39;a, &#39;gcx, &#39;tcx&gt;&gt;::force_query_with_job::h7a6693495921f881
  22:        0x10d89432b - rustc::ty::query::plumbing::&lt;impl rustc::ty::context::TyCtxt&lt;&#39;a, &#39;gcx, &#39;tcx&gt;&gt;::try_get_with::hc580e739dda9bdd3
  23:        0x10d906d6f - rustc::ty::query::plumbing::&lt;impl rustc::ty::context::TyCtxt&lt;&#39;a, &#39;gcx, &#39;tcx&gt;&gt;::ensure_query::h099f19c1d38763ed
  24:        0x10baac45b - rustc::session::Session::track_errors::hf9a6f2a242c90b0b
  25:        0x10bb6fcbf - rustc_typeck::check::typeck_item_bodies::h4534ee4d734144a1
  26:        0x10b942ea6 - rustc::ty::query::__query_compute::typeck_item_bodies::hf568d3995a6c4784
  27:        0x10ba8070b - rustc::ty::query::&lt;impl rustc::ty::query::config::QueryAccessors&lt;&#39;tcx&gt; for rustc::ty::query::queries::typeck_item_bodies&lt;&#39;tcx&gt;&gt;::compute::h7b6aface07086eb1
  28:        0x10b95a166 - rustc::dep_graph::graph::DepGraph::with_task_impl::hb1b264e398d9686a
  29:        0x10ba8d101 - &lt;rustc::ty::query::plumbing::JobOwner&lt;&#39;a, &#39;tcx, Q&gt;&gt;::start::hc63f00cac165842f
  30:        0x10b9b56e9 - rustc::ty::query::plumbing::&lt;impl rustc::ty::context::TyCtxt&lt;&#39;a, &#39;gcx, &#39;tcx&gt;&gt;::force_query_with_job::h454b1e98cb985f5e
  31:        0x10b982ff7 - rustc::ty::query::plumbing::&lt;impl rustc::ty::context::TyCtxt&lt;&#39;a, &#39;gcx, &#39;tcx&gt;&gt;::try_get_with::h5572ff8db339f814
  32:        0x10b963997 - rustc::util::common::time::h9f12939f16f76f2b
  33:        0x10bb0a296 - rustc_typeck::check_crate::h842d9672d6af315a
  34:        0x10acc632b - &lt;std::thread::local::LocalKey&lt;T&gt;&gt;::with::h63437dce8de12658
  35:        0x10aca74eb - rustc::ty::context::TyCtxt::create_and_enter::h673adfdda68da1ea
  36:        0x10addaa98 - rustc_driver::driver::phase_3_run_analysis_passes::h67cf81730cc3ec14
  37:        0x10ada44a5 - rustc_driver::driver::compile_input::ha5fcb3f0c8f48e47
  38:        0x10ad06f4e - rustc_driver::run_compiler_with_pool::haa8beec656c50be8
  39:        0x10acb287e - &lt;scoped_tls::ScopedKey&lt;T&gt;&gt;::set::hd44e699e53d15e75
  40:        0x10ad05eb8 - rustc_driver::run_compiler::hc40f67821fa523f1
  41:        0x10acb23cb - &lt;scoped_tls::ScopedKey&lt;T&gt;&gt;::set::hc5ff8cbf82c6994c
  42:        0x10ac8239d - syntax::with_globals::hf12d7f48e28fa87c
  43:        0x10fe868fe - __rust_maybe_catch_panic
  44:        0x10addc49d - &lt;F as alloc::boxed::FnBox&lt;A&gt;&gt;::call_box::h1a1055a3d353ec75
  45:        0x10fe5f8f7 - std::sys_common::thread::start_thread::h0f67f5321d68e7d5
  46:        0x10fe6a738 - std::sys::unix::thread::Thread::new::thread_start::h1398251991321fad
  47:     0x7fff57254660 - _pthread_body
  48:     0x7fff5725450c - _pthread_start
query stack during panic:
#0 [typeck_tables_of] processing `საჭმელად_გემრიელი_სადილი`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev running on x86_64-apple-darwin

note: compiler flags: -Z treat-err-as-bug
</pre></div>



<a name="154099564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099564">(Dec 31 2018 at 20:03)</a>:</h4>
<p>Interesting.</p>



<a name="154099565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099565">(Dec 31 2018 at 20:03)</a>:</h4>
<p><code>config.toml</code> has this:</p>
<div class="codehilite"><pre><span></span># =============================================================================
# Options for compiling Rust code itself
# =============================================================================
[rust]

# Indicates that the build should be optimized for debugging Rust. Note that
# this is typically not what you want as it takes an incredibly large amount of
# time to have a debug-mode rustc compile any code (notably libstd). If this
# value is set to `true` it will affect a number of configuration options below
# as well, if unconfigured.
debug = false

# Whether or not to optimize the compiler and standard library
# Note: the slowness of the non optimized compiler compiling itself usually
#       outweighs the time gains in not doing optimizations, therefore a
#       full bootstrap takes much more time with optimize set to false.
#optimize = true

# Number of codegen units to use for each compiler invocation. A value of 0
# means &quot;the number of cores on this machine&quot;, and 1+ is passed through to the
# compiler.
codegen-units = 0

# Whether or not debug assertions are enabled for the compiler and standard
# library. Also enables compilation of debug! and trace! logging macros.
debug-assertions = false

# Whether or not debuginfo is emitted
#debuginfo = true

# Whether or not line number debug information is emitted
debuginfo-lines = true
</pre></div>



<a name="154099566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099566">(Dec 31 2018 at 20:03)</a>:</h4>
<p>Note last line</p>



<a name="154099567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099567">(Dec 31 2018 at 20:03)</a>:</h4>
<p>that might be it</p>



<a name="154099607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099607">(Dec 31 2018 at 20:04)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> <br>
I use the macOs Mojave as my Rustc development platform.</p>



<a name="154099630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099630">(Dec 31 2018 at 20:05)</a>:</h4>
<p>Let me double check my config.toml</p>



<a name="154099992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099992">(Dec 31 2018 at 20:15)</a>:</h4>
<p>Then there should be <em>some</em> backtrace output with that environment variable set, even it it does not contain filenames/etc</p>



<a name="154099999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154099999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154099999">(Dec 31 2018 at 20:15)</a>:</h4>
<p>As long as you’re on x86{,_64}.</p>



<a name="154100001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154100001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154100001">(Dec 31 2018 at 20:15)</a>:</h4>
<p>libbacktrace may not support other architectures well/at all.</p>



<a name="154101992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154101992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154101992">(Dec 31 2018 at 21:10)</a>:</h4>
<p>debuginfo-lines is set to true in my case <span class="emoji emoji-1f641" title="frown">:frown:</span></p>



<a name="154102055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154102055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154102055">(Dec 31 2018 at 21:12)</a>:</h4>
<div class="codehilite"><pre><span></span># Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
 #backtrace = true
</pre></div>


<p>How about that line ? Its commented out in my case</p>



<a name="154102124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154102124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154102124">(Dec 31 2018 at 21:14)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> <br>
Before <code>RUST_BACKTRACE=1</code>, it would give me nothing but after setting it, I got some info <br>
<code>thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/blitz/rustc-dev/rust/src/libcore/slice/mod.rs:2455</code></p>
<p>Though not the entire call stack as <span class="user-mention" data-user-id="119031">@Esteban Küber</span>  gets.</p>



<a name="154102178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154102178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154102178">(Dec 31 2018 at 21:16)</a>:</h4>
<div class="codehilite"><pre><span></span>diff config.toml config.toml.example
22c22
&lt; optimize = false
---
&gt; #optimize = true
31c31
&lt; release-debuginfo = true
---
&gt; #release-debuginfo = false
34c34
&lt; assertions = true
---
&gt; #assertions = false
278c278
&lt; codegen-units = 0
---
&gt; #codegen-units = 1
286c286
&lt; debug-assertions = true
---
&gt; #debug-assertions = false
289c289
&lt; debuginfo = true
---
&gt; #debuginfo = false
292c292
&lt; debuginfo-lines = true
---
&gt; #debuginfo-lines = false
401c401,406
&lt; jemalloc = false
---
&gt; #jemalloc = false
&gt;
&gt; # Run tests in various test suites with the &quot;nll compare mode&quot; in addition to
&gt; # running the tests in normal mode. Largely only used on CI and during local
&gt; # development of NLL
&gt; #test-compare-mode = false
</pre></div>



<a name="154201408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154201408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154201408">(Jan 02 2019 at 21:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <br>
This is the panic I was referring to</p>



<a name="154202556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154202556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154202556">(Jan 02 2019 at 21:28)</a>:</h4>
<p>btw if you are having trouble with <code>RUST_BACKTRACE</code> for some reason, <span class="user-mention" data-user-id="128294">@blitzerr</span>, you might try using <code>lldb</code> to get a backtrace</p>



<a name="154205932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154205932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154205932">(Jan 02 2019 at 22:30)</a>:</h4>
<p>Do you mean, building the compiler from inside lldb so it breaks into lldb when it hits the panic ?</p>



<a name="154206279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154206279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154206279">(Jan 02 2019 at 22:37)</a>:</h4>
<p>yes but it's all much more painful when it dies during bootstrapping</p>



<a name="154206320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154206320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154206320">(Jan 02 2019 at 22:38)</a>:</h4>
<p>we used to have a nice tool for that but it stopped working for me at least</p>



<a name="154220143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/154220143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#154220143">(Jan 03 2019 at 04:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <br>
How do you invoke x.py from within the lldb ?</p>



<a name="157098834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/157098834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#157098834">(Jan 29 2019 at 11:43)</a>:</h4>
<p>I wouldn't invoke <code>x.py</code> from within <code>lldb</code>. I would use <code>x.py build</code> with ... I think <code>--verbose</code> ... to observe the actual command line invocation of <code>rustc</code>, and then use that command line with <code>lldb</code>. ... <strong>Except</strong> my memory is that this workflow is often foiled by <code>x.py</code> setting environment variables that you'll need to replicate yourself.</p>



<a name="157275470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/157275470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#157275470">(Jan 31 2019 at 14:33)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="116083">@pnkfelix</span></p>



<a name="157275540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/157275540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#157275540">(Jan 31 2019 at 14:34)</a>:</h4>
<p>There's a couple ways to work around the above problem</p>



<a name="157275567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/157275567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#157275567">(Jan 31 2019 at 14:34)</a>:</h4>
<p>one of the most direct hacks is to just find out what the environment settings are, by making the <code>rustc</code> invocation run <code>env</code> first to print that out</p>



<a name="157275595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20panic/near/157275595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20panic.html#157275595">(Jan 31 2019 at 14:35)</a>:</h4>
<p>I can't remember if the best way to do this is to override the <code>RUSTC</code> environment variable before invoking <code>x.py</code>, or if there's a better approach.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>